home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbdb
/
sample.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
12KB
|
494 lines
VERSION 2.00
Begin Form Rollodex
BorderStyle = 3 'Fixed Double
Caption = "Sample Address Book"
ClientHeight = 4440
ClientLeft = 1050
ClientTop = 1815
ClientWidth = 7560
Height = 4845
Left = 990
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4440
ScaleWidth = 7560
Top = 1470
Width = 7680
Begin TextBox WorkPhone
Height = 372
Left = 1680
TabIndex = 9
Text = "(908) 707-1316"
Top = 3960
Width = 1332
End
Begin TextBox HomePhone
Height = 372
Left = 1680
TabIndex = 8
Text = "(908) 707-1316"
Top = 3480
Width = 1332
End
Begin TextBox ThisRec
Height = 372
Left = 6960
TabIndex = 23
Top = 3036
Width = 492
End
Begin TextBox Zip
Height = 372
Left = 1680
TabIndex = 7
Text = "08807"
Top = 3000
Width = 1092
End
Begin TextBox State
Height = 372
Left = 1680
TabIndex = 6
Text = "NJ"
Top = 2520
Width = 372
End
Begin TextBox City
Height = 372
Left = 1680
TabIndex = 5
Text = "Bridgewater"
Top = 2040
Width = 2292
End
Begin CommandButton Quit
Caption = "E&xit"
Height = 492
Left = 6360
TabIndex = 22
Top = 1920
Width = 1092
End
Begin TextBox Address
Height = 372
Left = 1680
TabIndex = 4
Text = "135 Chestnut Street"
Top = 1560
Width = 3972
End
Begin TextBox Contact
Height = 372
Left = 1680
TabIndex = 3
Text = "02/06/1961"
Top = 1080
Width = 1092
End
Begin CommandButton New
Caption = "&New"
Height = 492
Left = 6360
TabIndex = 21
Top = 840
Width = 1092
End
Begin TextBox Lname
Height = 372
Left = 1680
TabIndex = 2
Text = "Marquis"
Top = 600
Width = 2052
End
Begin CommandButton Save
Caption = "&Save"
Height = 492
Left = 6360
TabIndex = 20
Top = 240
Width = 1092
End
Begin TextBox Fname
Height = 372
Left = 1680
TabIndex = 1
Text = "Hank"
Top = 120
Width = 1092
End
Begin VScrollBar Record
Height = 4452
Left = 5880
TabIndex = 0
Top = 0
Width = 252
End
Begin TextBox Text1
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Enabled = 0 'False
Height = 4572
Left = 6144
TabIndex = 19
Top = -36
Width = 1416
End
Begin Label Label9
Alignment = 1 'Right Justify
Caption = "&Work phone:"
Height = 372
Left = 480
TabIndex = 18
Top = 4080
Width = 1092
End
Begin Label Label8
Alignment = 1 'Right Justify
Caption = "&Home phone:"
Height = 372
Left = 120
TabIndex = 17
Top = 3600
Width = 1452
End
Begin Label Label7
Alignment = 1 'Right Justify
Caption = "&Zip code:"
Height = 372
Left = 480
TabIndex = 16
Top = 3120
Width = 1092
End
Begin Label Label10
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "Record no:"
Height = 492
Left = 6168
TabIndex = 24
Top = 3000
Width = 768
End
Begin Label Label6
Alignment = 1 'Right Justify
Caption = "&State:"
Height = 372
Left = 480
TabIndex = 15
Top = 2640
Width = 1092
End
Begin Label Label5
Alignment = 1 'Right Justify
Caption = "&City:"
Height = 372
Left = 480
TabIndex = 14
Top = 2160
Width = 1092
End
Begin Label Label4
Alignment = 1 'Right Justify
Caption = "&Address:"
Height = 372
Left = 480
TabIndex = 13
Top = 1680
Width = 1092
End
Begin Label Label3
Alignment = 1 'Right Justify
Caption = "Last &contact:"
Height = 372
Left = 480
TabIndex = 12
Top = 1200
Width = 1092
End
Begin Label Label2
Alignment = 1 'Right Justify
Caption = "Last &name:"
Height = 372
Left = 480
TabIndex = 11
Top = 720
Width = 1092
End
Begin Label Label1
Alignment = 1 'Right Justify
Caption = "&First name:"
Height = 252
Left = 480
TabIndex = 10
Top = 240
Width = 1092
End
End
DefInt A-Z
'--- make the database handle a shared variable
Dim Handle
Dim RecData$
Dim RecNum&
Sub Address_LostFocus ()
FldData$ = Address.Text
PutFLD Handle, Status, 4, FldName$, FldData$, RecData$
End Sub
Sub City_LostFocus ()
FldData$ = City.Text
PutFLD Handle, Status, 5, FldName$, FldData$, RecData$
End Sub
Sub ClearForm ()
'
'Clears out a form
'
FldData$ = ""
FName.Text = FldData$
LName.Text = FldData$
Contact.Text = FldData$
Address.Text = FldData$
City.Text = FldData$
State.Text = FldData$
Zip.Text = FldData$
HomePhone.Text = FldData$
WorkPhone.Text = FldData$
End Sub
Sub Contact_LostFocus ()
FldData$ = Contact.Text
PutFLD Handle, Status, 3, FldName$, FldData$, RecData$
End Sub
Sub DisplayRecord (RecNum&)
ThisRec.Text = LTrim$(Str$(RecNum&))
ReDim Flds$(0)
GetFLDS Handle, Status, NumFlds, Flds$(), RecNum&
If Status Then Exit Sub
FName.Text = Flds$(1)
LName.Text = Flds$(2)
Contact.Text = Flds$(3)
Address.Text = Flds$(4)
City.Text = Flds$(5)
State.Text = Flds$(6)
Zip.Text = Flds$(7)
HomePhone.Text = Flds$(8)
WorkPhone.Text = Flds$(9)
End Sub
Sub EndProgram ()
'
'Close database, unload server and exit program
'